﻿namespace Utils
{
    public static class StringUtil
    {
        public static string SafeSubstringRight(this string value, int length)
        {
            if (string.IsNullOrEmpty(value)) return string.Empty;
            return value[Math.Max(0, value.Length - length)..];
        }

        public static string SafeSubstringLeft(this string value, int length)
        {
            if (string.IsNullOrEmpty(value)) return string.Empty;
            return value[Math.Max(0, length)..];
        }
    }
}
